#ifndef __SPI_H__
#define __SPI_H__

#ifdef __cplusplus
 extern "C" {
#endif

#define SPI_TypeDef char
#define SPI01 "/dev/spidev0.0"
#define SPI02 "/dev/spidev0.1"
#define assert_param(expr) ((void)0)
#define FunctionalState int
#define DISABLE 0
#define ENABLE 1

#define DEV_ID_ID               0x00

int readfrom_spi_serial
(
    unsigned char       headerLength,
    unsigned char * headerBuffer,
    unsigned long       readlength,
    unsigned char       *readBuffer
);

int dwt_readfromdevice
(
    unsigned char  recordNumber,
    unsigned char  index,
    unsigned long   length,
    unsigned char   *buffer
);

int readfrom_spi_serial
(
    unsigned char       headerLength,
    unsigned char * headerBuffer,
    unsigned long       readlength,
    unsigned char       *readBuffer
);

int writetospi_serial
(
    unsigned char       headerLength,
    unsigned char	*headerBuffer,
    unsigned int       bodylength,
    unsigned char	*bodyBuffer
);

int dwt_writetodevice
(
    unsigned int   recordNumber,
    unsigned int   index,
    unsigned int   length,
    unsigned char  *buffer
);

unsigned long dwt_read32bitoffsetreg(int regFileID,int regOffset);
unsigned long instancereaddeviceid(void);
unsigned long dwt_readdevid(void);





#ifdef __cplusplus
}
#endif

#endif /* __SPI_H__ */
